package Code.StaticDemo;

import java.util.ArrayList;

public class ListUtil {
    private ListUtil(){

    }

    //获取集合中追打学生的年龄
    public static int getAgeMax(ArrayList<Student> list){
        int max = list.get(0).getAge();;
        for (int i = 1; i < list.size(); i++) {
            int age = list.get(i).getAge();
            if (age >max){
                max = age;
            }
        }
        return max;
    }
}
